﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
           
            //Console.WriteLine("Hello Wold. C#");

            //UseTypeInference();
            //UseString();
            //TestSwitch();
            //UseArray();
            UseFormatString();
            return;
        }

        //use type inference
        static void UseTypeInference()
        {
            var name = "name-string";
            var age = 25;
            var isRabbit = true;

            Type nameType = name.GetType();
            Type ageType = age.GetType();
            Type isRabbitType = isRabbit.GetType();

            Console.WriteLine(nameType.ToString());
            Console.WriteLine(ageType.ToString());
            Console.WriteLine(isRabbitType.ToString());

        }

        //use string
        static void UseString()
        {
            string s1 = "ABC";
            string s2 = s1;
            
            Console.WriteLine(s1);
            Console.WriteLine(s2);
        }
        
        //test switch
        static void TestSwitch()
        {
            const string a = "b";
            const string b = "k";
            string k = "b";
            switch(k)
            {
                case a:
                    Console.WriteLine(a);
                    break;
                case b:
                    Console.WriteLine(b);
                    break;
                default:
                    break;

            }

            const int c = 1;
            const int d = 2;
            int e = 1;
            switch (e)
            {
                case c:
                    Console.WriteLine(c.ToString());
                    break;
                case d:
                    Console.WriteLine(d.ToString());
                    break;
                default:
                    break;
            }
        }

        //use array
        static void UseArray()
        {
            int[] a = {1,2,3};
            Console.WriteLine(a.Length.ToString());
        }

        //use console format string
        static void UseFormatString()
        {
            int i = 10;
            double j = 1.12334455;
            double p = 0.012;

            Console.WriteLine("{0,3}",j);
        }
    }
}
